<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>个人资料</title>
    <!-- icon图标 -->
    <link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
    <!-- 样式初始化 -->
    <link rel="stylesheet" href="./css/base1.css">
    <!-- 公共样式 -->
    <link rel="stylesheet" href="./css/common1.css">
    <!-- 字体图标 -->
    <link rel="stylesheet" href="./lib/iconfont/iconfont.css">
    <link rel="stylesheet" href="https://at.alicdn.com/t/font_2143783_iq6z4ey5vu.css">
    <!-- 主页样式 -->
    <link rel="stylesheet" href="./css/register.css">

    <script src="js/axios.min.js"></script>
    <script src="js/vue.min.js"></script>
    <!-- 引入样式 -->
    <link rel="stylesheet" href="ele-2.15.7/theme-chalk/index.css">
    <!-- 引入组件库 -->
    <script src="ele-2.15.7/index.js"></script>
</head>
<style>

    .div1 {
        width : 100%;
        height : 50px;
        border :1px black solid;
    }
    .div2 {
        margin-top : 10px;
        margin-left : 10px;
        width : 80px;
        height : 30px;
        float : left;
    }
    .div3 {
        margin-top : 10px;
        height : 30px;
    }
    .div3 a {
        margin-left : 30px;
        text-decoration : none;
        float: left;
    }

    .div4 {
        margin-top : 10px;
        height : 30px;
    }

    .div4 a {
        margin-left : 30px;
        text-decoration : none;
        float: left;
        cursor: pointer;
    }
    .xtx-card{
        height: 51px;
    }

    .card1 {
        background: #fff;
        width: 100%;
        height: 500px;
        margin-top: 50px;
    }

    .image {
        width: 100%;
        display: block;
    }

    .image1 {
        width: 100%;
        display: block;
    }

    el-col {
        width: 200px;
        height: 200px;
        display: inline-block;
    }
    el-row {
        width: 100%;
        height: 500px;
        display: inline-block;
    }
    el-card {
        width: 200px;
        height: 200px;
        display: inline-block;
    }


    .images li{
        margin-left: 10px;
        border: 1px solid black;
        width: 200px;
        height: 200px;
        float: left;
        list-style-type: none;
    }
    .images img{
        width: 200px;
        height: 170px;
    }

    .images1 li{
        margin-left: 10px;
        border: 1px solid black;
        width: 200px;
        height: 200px;
        float: left;
        list-style-type: none;
    }

    .images1 img{
        width: 200px;
        height: 170px;
    }
</style>
<body>
<!-- 头部导航 -->
<header>
    <!-- 快捷菜单 -->
    <div class="xtx-shortcut">
        <nav class="w">
            <ul class="top-nav fr">
                <li><a href="./login.html">请先登录</a></li>
                <li><a href="./register.html">免费注册</a></li>
                <li><a href="./order.html">我的订单</a></li>
                <li><a href="PersonalCenter.html">会员中心</a></li>
                <li><a href="javascript:;">帮助中心</a></li>
                <li class="about"><a href="javascript:;">联系我</a></li>
                <!-- 新窗口打开 -->
                <li class="concern"><a href="javascript:;">关注我</a></li>
                <li><a target="_blank" href="http://mcongblog.com/">我的博客</a></li>
            </ul>
        </nav>
    </div>
    <!-- 主导航 -->
    <div class="xtx-main-nav w">
        <!-- logo -->
        <h1 class="xtx-logo fl">
            <a href="javascript:;">小兔鲜儿</a>
        </h1>
        <!-- 顶部导航 -->
        <nav class="fl">
            <ul class="main-nav-font">
                <li>
                    <a href="index.html">首页</a>
                </li>
                <li>
                    <a href="javascript:;">生鲜</a>
                </li>
                <li>
                    <a href="javascript:;">美食</a>
                </li>
                <li>
                    <a href="javascript:;">餐厨</a>
                </li>
                <li>
                    <a href="javascript:;">电器</a>
                </li>
                <li>
                    <a href="javascript:;">居家</a>
                </li>
                <li>
                    <a href="javascript:;">洗护</a>
                </li>
                <li>
                    <a href="javascript:;">孕婴</a>
                </li>
                <li>
                    <a href="javascript:;">服装</a>
                </li>
            </ul>
        </nav>
        <div class="main-search fl">
            <input type="text" placeholder="搜一搜" />
            <div class="car">
                <span>2</span>
            </div>
        </div>
    </div>
</header>
<!-- 主体内容 -->
<section>
    <div class="xtx-wrapper">
        <div class="container" id="app">
            <!-- 卡片 -->
            <div class="xtx-card">

                <div >

                    <div class="div1" >
                        <div class="div2">商品种类</div>
                        <ul class="div3" style="display: inline-block">
                            <li style="float: left" v-for="item in tableData"><a href="#" @click="add(item.tname)">{{item.tname}}</a></li>
                        </ul >


                        <ul class="div4" style="display: none">
                            <li style="float: left" v-for="item in tableNameData"><a  @click="add1(item.proname)">{{item.proname}}</a></li>
                        </ul >
                    </div>

                </div>
            </div>

            <div class="card1">

                <div class="hb clearfix">

                    <ul class="images" style="display: inline-block">
                        <li v-for="image, index in tableNameData" ><img :src="image.images" style="border-bottom: 1px solid black">
                        </li>
                    </ul>

                    <ul class="images1" style="display: none">
                        <li v-for="image, index in tablePronameData" ><img :src="image.images" style="border-bottom: 1px solid black">
                        </li>
                    </ul>

                </div>
            </div>

        </div>
    </div>


</section>
<!-- 底部 -->
<footer>
    <div class="xtx-footer w">
        <!-- 客户服务 -->
        <div class="footer-server fl">
            <p>客户服务</p>
            <div class="service">在线客服</div>
            <div class="question">问题反馈</div>
        </div>
        <!-- 关注我们 -->
        <div class="footer-we fl">
            <p>关注我们</p>
            <div class="number">公众号</div>
            <div class="weibo">微博</div>
        </div>
        <!-- 下载APP -->
        <div class="footer-download fl">
            <p>下载APP</p>
            <div class="code">
                <img src="./uploads/qrcode.png" alt="">
            </div>
            <div class="download">
                <p>扫秒二维码</p>
                <br />
                <p>立即下载APP</p>
                <a href="javascript:;">立即下载</a>
            </div>
        </div>
        <!-- 服务热线 -->
        <div class="footer-hotline fr">
            <p>服务热线</p>
            <div class="num">400-0000-000</div>
            <span>周一至周日 8:00-18:00</span>
        </div>
    </div>

    <div class="xtx-bottom">
        <div class="w">
            <div class="bottom-service">
                <div class="bottom-box">
                    <a href="javascript:;">价格亲民</a>
                    <a href="javascript:;">物流快捷</a>
                    <a href="javascript:;">品质新鲜</a>
                </div>
            </div>
            <div class="bottom-copyright">
                <ul>
                    <li><a href="javascript:;">关于我们</a></li>
                    <li><a href="javascript:;">帮助中心</a></li>
                    <li><a href="javascript:;">售后服务</a></li>
                    <li><a href="javascript:;">配送与验收</a></li>
                    <li><a href="javascript:;">商务合作</a></li>
                    <li><a href="javascript:;">搜索推荐</a></li>
                    <li><a target="_blank" href="http://mcongblog.com/">友情链接</a></li>
                </ul>
                <p>CopyRight © A Lucky Boy 版权所有</p>
            </div>
        </div>
    </div>
</footer>
<script src="./js/register.js"></script>
<script src="./js/common.js"></script>

</body>

</html>
<script>
    var v = new Vue({
        el: "#app",
        data: {
            tableData : [],
            tableNameData : [],
            tname : "",
            proname : "",
            tablePronameData : []
        },
        created() {
            this.query();
        },
        methods : {
            query() {
                axios.get("ProductCategoyTwoServlet.s", {
                    params: {
                        tname : this.tname,
                        proname : this.proname
                    }
                }).then(res => {
                    this.tableData = res.data;
                })
            },

            add(tname1) {
                axios.get("ProductCategoyServlet.s", {
                    params: {
                        tname : tname1,
                        proname : ""
                    }
                }).then(res => {
                    this.tableNameData = res.data;
                })
                const v = document.getElementsByClassName('div3').item(0);
                const vv = document.getElementsByClassName('div4').item(0);
                v.style.display = 'none';
                vv.style.display = 'block';
            },

            add1(proname) {
                axios.get("ProductCategoyServlet.s", {
                    params: {
                        tname : "",
                        proname : proname
                    }
                }).then(res => {
                    this.tablePronameData = res.data;
                })
                const v = document.getElementsByClassName('images').item(0);
                const vv = document.getElementsByClassName('images1').item(0);
                v.style.display = 'none';
                vv.style.display = 'block';
            },

            },
    });
</script>



